<?php

/**
 * Annotation form base class.
 *
 * @package    FinalsClub
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseAnnotationForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'              => new sfWidgetFormInputHidden(),
      'created_at'      => new sfWidgetFormDateTime(),
      'user_id'         => new sfWidgetFormPropelChoice(array('model' => 'User', 'add_empty' => false)),
      'annotate_type'   => new sfWidgetFormInput(),
      'state'           => new sfWidgetFormInput(),
      'author'          => new sfWidgetFormInput(),
      'date'            => new sfWidgetFormInput(),
      'code'            => new sfWidgetFormInput(),
      'gid'             => new sfWidgetFormInput(),
      'num'             => new sfWidgetFormInput(),
      'annotate_match'  => new sfWidgetFormInput(),
      'source_type'     => new sfWidgetFormInput(),
      'type'            => new sfWidgetFormInput(),
      'html_url'        => new sfWidgetFormInput(),
      'file_id'         => new sfWidgetFormPropelChoice(array('model' => 'File', 'add_empty' => true)),
      'note_id'         => new sfWidgetFormPropelChoice(array('model' => 'Note', 'add_empty' => true)),
      'book_id'         => new sfWidgetFormPropelChoice(array('model' => 'Book', 'add_empty' => true)),
      'book_section_id' => new sfWidgetFormPropelChoice(array('model' => 'Section', 'add_empty' => true)),
      'text'            => new sfWidgetFormTextarea(),
      'link_to'         => new sfWidgetFormTextarea(),
      'link_title'      => new sfWidgetFormInput(),
      'tags'            => new sfWidgetFormInput(),
      'context'         => new sfWidgetFormTextarea(),
      'color'           => new sfWidgetFormInput(),
      'subject'         => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'              => new sfValidatorPropelChoice(array('model' => 'Annotation', 'column' => 'id', 'required' => false)),
      'created_at'      => new sfValidatorDateTime(array('required' => false)),
      'user_id'         => new sfValidatorPropelChoice(array('model' => 'User', 'column' => 'id')),
      'annotate_type'   => new sfValidatorString(array('max_length' => 16, 'required' => false)),
      'state'           => new sfValidatorInteger(array('required' => false)),
      'author'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'date'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'code'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'gid'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'num'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'annotate_match'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'source_type'     => new sfValidatorInteger(),
      'type'            => new sfValidatorInteger(),
      'html_url'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'file_id'         => new sfValidatorPropelChoice(array('model' => 'File', 'column' => 'id', 'required' => false)),
      'note_id'         => new sfValidatorPropelChoice(array('model' => 'Note', 'column' => 'id', 'required' => false)),
      'book_id'         => new sfValidatorPropelChoice(array('model' => 'Book', 'column' => 'id', 'required' => false)),
      'book_section_id' => new sfValidatorPropelChoice(array('model' => 'Section', 'column' => 'id', 'required' => false)),
      'text'            => new sfValidatorString(array('required' => false)),
      'link_to'         => new sfValidatorString(array('required' => false)),
      'link_title'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'tags'            => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'context'         => new sfValidatorString(array('required' => false)),
      'color'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'subject'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('annotation[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Annotation';
  }


}
